home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / gtlayout.h < prev    next >
C/C++ Source or Header  |  1995-09-24  |  27KB  |  770 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1995 by Olaf `Olsen' Barthel
  5. **    Freely distributable.
  6. */
  7.  
  8. #ifndef _GTLAYOUT_H
  9. #define _GTLAYOUT_H
  10.  
  11.  
  12. /*****************************************************************************/
  13.  
  14.  
  15. #if !defined(_GTLAYOUT_GLOBAL_H) && !defined(SHARED_LIB) && !defined(LINK_LIB)
  16. #define SHARED_LIB 1
  17. #endif
  18.  
  19. #ifdef _DCC
  20. #ifndef __stdargs
  21. #define __stdargs __stkargs
  22. #endif    /* __stdargs */
  23. #ifndef __asm
  24. #define __asm __regargs
  25. #endif    /* __asm */
  26. #endif    /* _DCC */
  27.  
  28. #ifdef _GTLAYOUT_GLOBAL_H
  29. #define REG(x)    register __ ## x
  30. #define LIBENT    __asm __saveds
  31. #endif    /* _GTLAYOUT_GLOBAL_H */
  32.  
  33. #ifdef SHARED_LIB
  34. #define REG(x)
  35. #define LIBENT
  36. #endif    /* SHARED_LIB */
  37.  
  38. #ifdef LINK_LIB
  39. #define REG(x)
  40. #define LIBENT    __regargs
  41. #endif    /* LINK_LIB */
  42.  
  43.  
  44. /*****************************************************************************/
  45.  
  46.  
  47. #ifndef EXEC_TYPES_H
  48. #include <exec/types.h>
  49. #endif
  50.  
  51. #ifndef INTUITION_INTUITION_H
  52. #include <intuition/intuition.h>
  53. #endif
  54.  
  55. #ifndef UTILITY_TAGITEM_H
  56. #include <utility/tagitem.h>
  57. #endif
  58.  
  59. #ifndef INTUITION_GADGETCLASS_H
  60. #include <intuition/gadgetclass.h>
  61. #endif
  62.  
  63. #ifndef LIBRARIES_GADTOOLS_H
  64. #include <libraries/gadtools.h>
  65. #endif
  66.  
  67.  
  68. /*****************************************************************************/
  69.  
  70.  
  71. /* Where to place a gadget label */
  72. typedef enum PlacementTypes
  73. {
  74.     PLACE_LEFT,
  75.     PLACE_RIGHT,
  76.     PLACE_ABOVE,
  77.     PLACE_IN,
  78.     PLACE_BELOW
  79. } PlacementTypes;
  80.  
  81. /* How to align text lines in BOX_KIND gadgets */
  82. typedef enum AlignmentTypes
  83. {
  84.     ALIGNTEXT_LEFT,
  85.     ALIGNTEXT_CENTERED,
  86.     ALIGNTEXT_RIGHT,
  87.     ALIGNTEXT_PAD
  88. } AlignmentTypes;
  89.  
  90. /* The button images available for TAPEDECK_KIND gadgets. */
  91. typedef enum TapeDeckButtonTypes
  92. {
  93.     TDBT_BACKWARD,
  94.     TDBT_FORWARD,
  95.     TDBT_PREVIOUS,
  96.     TDBT_NEXT,
  97.     TDBT_STOP,
  98.     TDBT_PAUSE,
  99.     TDBT_RECORD,
  100.     TDBT_REWIND,
  101.     TDBT_EJECT,
  102.     TDBT_PLAY,
  103.  
  104.     TDBTLAST
  105. } TapeDeckButtonTypes;
  106.  
  107. /* How to align the window opened by LT_Build() on the screen. */
  108. #define ALIGNF_RIGHT        (1 << 0)
  109. #define ALIGNF_LEFT        (1 << 1)
  110. #define ALIGNF_TOP        (1 << 2)
  111. #define ALIGNF_BOTTOM        (1 << 3)
  112. #define ALIGNF_EXTRA_RIGHT    (1 << 4)
  113. #define ALIGNF_EXTRA_LEFT    (1 << 5)
  114. #define ALIGNF_EXTRA_TOP    (1 << 6)
  115. #define ALIGNF_EXTRA_BOTTOM    (1 << 7)
  116.  
  117. /* Handy for LT_LevelWidth and LT_NewLevelWidth */
  118. typedef LONG (* __stdargs DISPFUNC)(struct Gadget *gad,WORD value);
  119.  
  120.  
  121. /*****************************************************************************/
  122.  
  123.  
  124. /* Generic tags, applicable for several object types */
  125. #define LA_Chars        TAG_USER+2
  126. #define LA_LabelPlace        TAG_USER+3
  127. #define LA_ExtraSpace        TAG_USER+4
  128. #define LA_NoKey        TAG_USER+30
  129. #define LA_HighLabel        TAG_USER+31
  130. #define LA_LabelText        TAG_USER+37
  131. #define LA_LabelID        TAG_USER+38
  132. #define LA_ID            TAG_USER+39
  133. #define LA_Type            TAG_USER+40
  134. #define LA_PageSelector        TAG_USER+79
  135. #define LA_LabelChars        TAG_USER+107
  136.  
  137. /* Storage type tags */
  138. #define LA_BYTE            TAG_USER+63
  139. #define LA_UBYTE        TAG_USER+64
  140. #define LA_WORD            TAG_USER+65
  141. #define LA_BOOL            TAG_USER+65
  142. #define LA_UWORD        TAG_USER+66
  143. #define LA_LONG            TAG_USER+67
  144. #define LA_ULONG        TAG_USER+68
  145. #define LA_STRPTR        TAG_USER+69
  146. #define LA_FRACTION        TAG_USER+68
  147.  
  148. /* for use with LT_GetAttributes() only */
  149. #define LA_Left            TAG_USER+16
  150. #define LA_Top            TAG_USER+17
  151. #define LA_Width        TAG_USER+18
  152. #define LA_Height        TAG_USER+19
  153. #define LA_LabelLeft        TAG_USER+114
  154. #define LA_LabelTop        TAG_USER+115
  155.  
  156. /* BOOPSI_KIND */
  157. #define LABO_TagCurrent        TAG_USER+119
  158. #define LABO_TagTextAttr    TAG_USER+120
  159. #define LABO_TagDrawInfo    TAG_USER+121
  160. #define LABO_TagLink        TAG_USER+129
  161. #define LABO_TagScreen        TAG_USER+132
  162. #define LABO_Link        LALV_Link
  163. #define LABO_ClassInstance    TAG_USER+122
  164. #define LABO_ClassName        TAG_USER+123
  165. #define LABO_ClassLibraryName    TAG_USER+124
  166. #define LABO_ExactWidth        TAG_USER+127
  167. #define LABO_ExactHeight    TAG_USER+128
  168. #define LABO_RelFontHeight    TAG_USER+131
  169. #define LABO_Object        TAG_USER+133
  170. #define LABO_FullWidth        TAG_USER+135
  171. #define LABO_FullHeight        TAG_USER+136
  172. #define LABO_ActivateHook    TAG_USER+141
  173.  
  174. /* BOX_KIND */
  175. #define LABX_Labels        TAG_USER+12
  176. #define LABX_Lines        TAG_USER+13
  177. #define LABX_Rows        TAG_USER+1
  178. #define LABX_Index        TAG_USER+14
  179. #define LABX_Text        TAG_USER+15
  180. #define LABX_AlignText        TAG_USER+27
  181. #define LABX_DrawBox        TAG_USER+11
  182. #define LABX_FirstLabel        TAG_USER+44
  183. #define LABX_LastLabel        TAG_USER+45
  184. #define LABX_ReserveSpace    TAG_USER+72
  185. #define LABX_LabelTable        TAG_USER+98
  186.  
  187. /* BUTTON_KIND */
  188. #define LABT_ReturnKey        TAG_USER+34
  189. #define LABT_DefaultButton    TAG_USER+34
  190. #define LABT_EscKey        TAG_USER+56
  191. #define LABT_ExtraFat        TAG_USER+29
  192. #define LABT_Lines        TAG_USER+140
  193. #define LABT_FirstLine        TAG_USER+44
  194. #define LABT_LastLine        TAG_USER+45
  195. #define LABT_DefaultCorrection    TAG_USER+145
  196. #define LABT_Smaller        TAG_USER+147
  197.  
  198. /* CYCLE_KIND */
  199. #define LACY_FirstLabel        TAG_USER+44
  200. #define LACY_LastLabel        TAG_USER+45
  201. #define LACY_LabelTable        TAG_USER+98
  202. #define LACY_AutoPageID        TAG_USER+103
  203. #define LACY_TabKey        TAG_USER+118
  204.  
  205. /* FRACTION_KIND */
  206. #define LAFC_MaxChars        TAG_USER+20
  207. #define LAFC_Number        TAG_USER+21
  208. #define LAFC_LastGadget        TAG_USER+28
  209. #define LAFC_Min        TAG_USER+23
  210. #define LAFC_Max        TAG_USER+24
  211. #define LAFC_HistoryLines    TAG_USER+59
  212. #define LAFC_HistoryHook    TAG_USER+80
  213. #define LAFC_Activate        TAG_USER+148
  214.  
  215. /* FRAME_KIND */
  216. #define LAFR_InnerWidth        TAG_USER+9
  217. #define LAFR_InnerHeight    TAG_USER+10
  218. #define LAFR_DrawBox        TAG_USER+11
  219. #define LAFR_RefreshHook    TAG_USER+117
  220.  
  221. /* GAUGE_KIND */
  222. #define LAGA_Percent        TAG_USER+36
  223. #define LAGA_InfoLength        TAG_USER+70
  224. #define LAGA_InfoText        TAG_USER+71
  225. #define LAGA_NoTicks        TAG_USER+143
  226. #define LAGA_Discrete        TAG_USER+144
  227. #define LAGA_Tenth        TAG_USER+144
  228.  
  229. /* INTEGER_KIND */
  230. #define LAIN_LastGadget        TAG_USER+28
  231. #define LAIN_Min        TAG_USER+23
  232. #define LAIN_Max        TAG_USER+24
  233. #define LAIN_UseIncrementers    TAG_USER+57
  234. #define LAIN_Incrementers    TAG_USER+57
  235. #define LAIN_HistoryLines    TAG_USER+59
  236. #define LAIN_HistoryHook    TAG_USER+80
  237. #define LAIN_IncrementerHook    TAG_USER+85
  238. #define LAIN_Activate        TAG_USER+148
  239.  
  240. /* LISTVIEW_KIND */
  241. #define LALV_ExtraLabels    TAG_USER+26
  242. #define LALV_Labels        TAG_USER+33
  243. #define LALV_CursorKey        TAG_USER+35
  244. #define LALV_Columns        TAG_USER+2
  245. #define LALV_Lines        TAG_USER+1
  246. #define LALV_Link        TAG_USER+7
  247. #define LALV_FirstLabel        TAG_USER+44
  248. #define LALV_LastLabel        TAG_USER+45
  249. #define LALV_MaxGrowX        TAG_USER+77
  250. #define LALV_MaxGrowY        TAG_USER+78
  251. #define LALV_LabelTable        TAG_USER+98
  252. #define LALV_LockSize        TAG_USER+106
  253. #define LALV_ResizeX        TAG_USER+109
  254. #define LALV_ResizeY        TAG_USER+110
  255. #define LALV_MinChars        TAG_USER+111
  256. #define LALV_MinLines        TAG_USER+112
  257. #define LALV_FlushLabelLeft    TAG_USER+113
  258. #define LALV_TextAttr        TAG_USER+138
  259. #define LALV_AutoPageID        TAG_USER+103
  260.  
  261. /* LEVEL_KIND */
  262. #define LAVL_Min        GTSL_Min
  263. #define LAVL_Max        GTSL_Max
  264. #define LAVL_Level        GTSL_Level
  265. #define LAVL_LevelFormat    GTSL_LevelFormat
  266. #define LAVL_LevelPlace        GTSL_LevelPlace
  267. #define LAVL_DispFunc        GTSL_DispFunc
  268. #define LAVL_FullCheck        LASL_FullCheck
  269.  
  270. /* MX_KIND */
  271. #define LAMX_FirstLabel        TAG_USER+44
  272. #define LAMX_LastLabel        TAG_USER+45
  273. #define LAMX_LabelTable        TAG_USER+98
  274. #define LAMX_TabKey        TAG_USER+118
  275. #define LAMX_AutoPageID        TAG_USER+103
  276.  
  277. /* PALETTE_KIND */
  278. #define LAPA_SmallPalette    TAG_USER+32
  279. #define LAPA_Lines        LA_Lines
  280. #define LAPA_UsePicker        TAG_USER+137
  281. #define LAPA_Picker        TAG_USER+137
  282.  
  283. /* PASSWORD_KIND */
  284. #define LAPW_String             GTST_String
  285. #define LAPW_LastGadget        TAG_USER+28
  286. #define LAPW_HistoryLines    TAG_USER+59
  287. #define LAPW_HistoryHook    TAG_USER+80
  288. #define LAPW_Activate        TAG_USER+148
  289.  
  290. /* POPUP_KIND */
  291. #define LAPU_FirstLabel        TAG_USER+44
  292. #define LAPU_LastLabel        TAG_USER+45
  293. #define LAPU_LabelTable        TAG_USER+98
  294. #define LAPU_AutoPageID        TAG_USER+103
  295. #define LAPU_TabKey        TAG_USER+118
  296. #define LAPU_Labels        GTCY_Labels
  297. #define LAPU_Active        GTCY_Active
  298.  
  299. /* SLIDER_KIND */
  300. #define LASL_FullCheck        TAG_USER+22
  301.  
  302. /* SCROLLER_KIND */
  303. #define LASC_Thin        TAG_USER+62
  304.  
  305. /* STRING_KIND */
  306. #define LAST_LastGadget        TAG_USER+28
  307. #define LAST_Link        TAG_USER+7
  308. #define LAST_Picker        TAG_USER+5
  309. #define LAST_UsePicker        TAG_USER+5
  310. #define LAST_HistoryLines    TAG_USER+59
  311. #define LAST_HistoryHook    TAG_USER+80
  312. #define LAST_CursorPosition    TAG_USER+105
  313. #define LAST_Activate        TAG_USER+148
  314.  
  315. /* TAB_KIND */
  316. #define LATB_FirstLabel        TAG_USER+44
  317. #define LATB_LastLabel        TAG_USER+45
  318. #define LATB_LabelTable        TAG_USER+98
  319. #define LATB_AutoPageID        TAG_USER+103
  320. #define LATB_TabKey        TAG_USER+118
  321. #define LATB_Labels        GTCY_Labels
  322. #define LATB_Active        GTCY_Active
  323. #define LATB_FullWidth        TAG_USER+149
  324. #define LATB_FullSize        TAG_USER+149
  325.  
  326. /* TAPEDECK_KIND */
  327. #define LATD_ButtonType        TAG_USER+86
  328. #define LATD_Toggle        TAG_USER+87
  329. #define LATD_Pressed        TAG_USER+88
  330. #define LATD_Smaller        TAG_USER+89
  331. #define LATD_Tick        TAG_USER+139
  332.  
  333. /* TEXT_KIND */
  334. #define LATX_Picker        TAG_USER+5
  335. #define LATX_UsePicker        TAG_USER+5
  336. #define LATX_LockSize        TAG_USER+106
  337.  
  338. /* VERTICAL_KIND, HORIZONTAL_KIND */
  339. #define LAGR_Spread        TAG_USER+6
  340. #define LAGR_SameSize        TAG_USER+8
  341. #define LAGR_LastAttributes    TAG_USER+46
  342. #define LAGR_ActivePage        TAG_USER+58
  343. #define LAGR_Frame        TAG_USER+104
  344. #define LAGR_IndentX        TAG_USER+130
  345. #define LAGR_IndentY        TAG_USER+134
  346. #define LAGR_NoIndent        TAG_USER+146
  347.  
  348. /* XBAR_KIND */
  349. #define LAXB_FullSize        TAG_USER+50
  350. #define LAXB_FullWidth        TAG_USER+50
  351.  
  352. /* Applicable for layout handle only */
  353. #define LAHN_Font        TAG_USER+41
  354. #define LAHN_AutoActivate    TAG_USER+42
  355. #define LAHN_LocaleHook        TAG_USER+4
  356. #define LAHN_CloningPermitted    TAG_USER+61
  357. #define LAHN_EditHook        TAG_USER+74
  358. #define LAHN_ExactClone        TAG_USER+75
  359. #define LAHN_MenuGlyphs        TAG_USER+76
  360. #define LAHN_Parent        TAG_USER+83
  361. #define LAHN_BlockParent    TAG_USER+84
  362. #define LAHN_SimpleClone    TAG_USER+90
  363. #define LAHN_ExitFlush        TAG_USER+108
  364. #define LAHN_UserData        TAG_USER+116
  365. #define LAHN_RawKeyFilter    TAG_USER+142
  366.  
  367. /* Applicable for menus only. */
  368. #define LAMN_FirstLabel        LABX_FirstLabel
  369. #define LAMN_LastLabel        LABX_LastLabel
  370. #define LAMN_LabelTable        TAG_USER+98
  371. #define LAMN_TitleText        (TAG_USER + 17000)
  372. #define LAMN_TitleID        (TAG_USER + 17001)
  373. #define LAMN_ItemText        (TAG_USER + 17002)
  374. #define LAMN_ItemID        (TAG_USER + 17003)
  375. #define LAMN_SubText        (TAG_USER + 17004)
  376. #define LAMN_SubID        (TAG_USER + 17005)
  377. #define LAMN_KeyText        (TAG_USER + 17006)
  378. #define LAMN_KeyID        (TAG_USER + 17007)
  379. #define LAMN_CommandText    (TAG_USER + 17008)
  380. #define LAMN_CommandID        (TAG_USER + 17009)
  381. #define LAMN_MutualExclude    (TAG_USER + 17010)
  382. #define LAMN_UserData        (TAG_USER + 17011)
  383. #define LAMN_Disabled        (TAG_USER + 17012)
  384. #define LAMN_CheckIt        (TAG_USER + 17013)
  385. #define LAMN_Checked        (TAG_USER + 17014)
  386. #define LAMN_Toggle        (TAG_USER + 17015)
  387. #define LAMN_Code        (TAG_USER + 17016)
  388. #define LAMN_Qualifier        (TAG_USER + 17017)
  389. #define LAMN_Char        (TAG_USER + 17018)
  390. #define LAMN_ID            (TAG_USER + 17019)
  391. #define LAMN_AmigaGlyph        (TAG_USER + 17020)
  392. #define LAMN_CheckmarkGlyph    (TAG_USER + 17021)
  393. #define LAMN_Error        (TAG_USER + 17022)
  394. #define LAMN_Screen        (TAG_USER + 17023)
  395. #define LAMN_TextAttr        (TAG_USER + 17024)
  396. #define LAMN_LayoutHandle    (TAG_USER + 17025)
  397. #define LAMN_Handle        (TAG_USER + 17025)
  398. #define LAMN_ExtraSpace        (TAG_USER + 17026)
  399.  
  400. /* Applicable for window only */
  401. #define LAWN_Menu        TAG_USER+25
  402. #define LAWN_UserPort        TAG_USER+47
  403. #define LAWN_Left        TAG_USER+48
  404. #define LAWN_Top        TAG_USER+49
  405. #define LAWN_Zoom        TAG_USER+50
  406. #define LAWN_MaxPen        TAG_USER+52
  407. #define LAWN_BelowMouse        TAG_USER+53
  408. #define LAWN_MoveToWindow    TAG_USER+54
  409. #define LAWN_AutoRefresh    TAG_USER+55
  410. #define LAWN_HelpHook        TAG_USER+73
  411. #define LAWN_Parent        TAG_USER+81
  412. #define LAWN_BlockParent    TAG_USER+82
  413. #define LAWN_SmartZoom        TAG_USER+91
  414. #define LAWN_Title        TAG_USER+92
  415. #define LAWN_TitleText        TAG_USER+92
  416. #define LAWN_Bounds        TAG_USER+93
  417. #define LAWN_ExtraWidth        TAG_USER+94
  418. #define LAWN_ExtraHeight    TAG_USER+95
  419. #define LAWN_IDCMP        TAG_USER+96
  420. #define LAWN_AlignWindow    TAG_USER+97
  421. #define LAWN_TitleID        TAG_USER+99
  422. #define LAWN_FlushLeft        TAG_USER+14000    /* NOTEZ-BIEN: TAG_USER+99 = WA_Dummy and can clash */
  423. #define LAWN_FlushTop        TAG_USER+14001    /*             with Intuition!                      */
  424. #define LAWN_Show        TAG_USER+14002
  425. #define LAWN_MenuTemplate    TAG_USER+14003
  426. #define LAWN_MenuTags        TAG_USER+14004
  427.  
  428. /* Private tags; do not use, or you'll run into trouble! */
  429. #define LA_Private1        TAG_USER+100
  430. #define LA_Private2        TAG_USER+101
  431.  
  432. /* Last tag item value used */
  433. #define LAST_TAG        TAG_USER+149
  434.  
  435.  
  436. /*****************************************************************************/
  437.  
  438.  
  439. /* Identifies the absence of a link for a listview or a string gadget */
  440. #define NIL_LINK        -2
  441.  
  442.  
  443. /*****************************************************************************/
  444.  
  445.  
  446.     /* String gadget type history hook support: you will either get
  447.      * the following value passed as the message parameter to your
  448.      * hook function, or a pointer to a null-terminated string you should
  449.      * copy and create a Node from, which you should then add to the tail
  450.      * of your history list. Place a pointer to your history list in the
  451.      * Hook.h_Data entry.
  452.      */
  453.  
  454. #define HISTORYHOOK_DISCARD_OLDEST    0    /* Discard oldest entry */
  455.  
  456.  
  457. /*****************************************************************************/
  458.  
  459.  
  460.     /* Refresh hook support: you will get the following structure
  461.      * passed as the message and a pointer to the LayoutHandle as
  462.      * the object.
  463.      */
  464.  
  465. typedef struct RefreshMsg
  466. {
  467.     LONG    ID;
  468.     WORD    Left,
  469.         Top,
  470.         Width,
  471.         Height;
  472. } RefreshMsg;
  473.  
  474. /*****************************************************************************/
  475.  
  476.  
  477.     /* Incrementer hook support: you will get the current value
  478.      * passed as the object and one of the following values as
  479.      * the message. Return the number to be used.
  480.      */
  481.  
  482. typedef enum IncrementerMsgTypes
  483. {
  484.     INCREMENTERMSG_DECREMENT = -1,    /* Decrement value */
  485.     INCREMENTERMSG_INITIAL   =  0,    /* Initial value passed upon gadget creation */
  486.     INCREMENTERMSG_INCREMENT =  1    /* Increment value */
  487. } IncrementerMsgTypes;
  488.  
  489.  
  490. /*****************************************************************************/
  491.  
  492.     /* Help key hook support: the hook will be called with a "struct IBox *"
  493.      * as the object and a "struct HelpMsg *". The IBox describes the object
  494.      * the mouse was positioned over, such as a button, a listview, etc.
  495.      * The "ObjectID" will indicate the ID of the object the mouse was
  496.      * positioned over. The ID will be -1 if no object was to be found.
  497.      */
  498.  
  499. typedef struct HelpMsg
  500. {
  501.     struct LayoutHandle    *Handle;    /* Window layout handle */
  502.     LONG             ObjectID;    /* ID of the object, -1 for full window */
  503. } HelpMsg;
  504.  
  505.  
  506. /*****************************************************************************/
  507.  
  508.  
  509. /* Obsolete tags, don't use in new code */
  510. #define LA_Lines        LABX_Rows
  511. #define LA_Spread        LAGR_Spread
  512. #define LA_SameSize        LAGR_SameSize
  513. #define LA_FullCheck        LASL_FullCheck
  514. #define LA_ExtraLabels        LALV_ExtraLabels
  515. #define LA_LastGadget        LAFC_LastGadget
  516. #define LA_SmallPalette        LAPA_SmallPalette
  517. #define LA_Labels        LALV_Labels
  518. #define LA_Picker        LATX_Picker
  519. #define LA_DrawBox        LAFR_DrawBox
  520. #define LA_FirstLabel        LABX_FirstLabel
  521. #define LA_LastLabel        LABX_LastLabel
  522. #define LA_LabelTable        LABX_LabelTable
  523. #define LA_Min            LAFC_Min
  524. #define LA_Max            LAFC_Max
  525. #define LA_Link            LALV_Link
  526. #define LA_Menu            LAWN_Menu
  527. #define LA_HistoryLines        LAST_HistoryLines
  528. #define LA_HistoryHook        LAST_HistoryHook
  529. #define LA_ReturnKey        LABT_ReturnKey
  530. #define LA_ExtraFat        LABT_ExtraFat
  531. #define LA_CursorKey        LALV_CursorKey
  532. #define STORE_BYTE        TAG_USER+63
  533. #define STORE_UBYTE        TAG_USER+64
  534. #define STORE_WORD        TAG_USER+65
  535. #define STORE_BOOL        TAG_USER+65
  536. #define STORE_UWORD        TAG_USER+66
  537. #define STORE_LONG        TAG_USER+67
  538. #define STORE_ULONG        TAG_USER+68
  539. #define STORE_STRPTR        TAG_USER+69
  540. #define STORE_FRACTION        TAG_USER+68
  541. #define LH_Font            TAG_USER+41
  542. #define LH_AutoActivate        TAG_USER+42
  543. #define LH_LocaleHook        TAG_USER+4
  544. #define LH_CloningPermitted    TAG_USER+61
  545. #define LH_EditHook        TAG_USER+74
  546. #define LH_ExactClone        TAG_USER+75
  547. #define LH_MenuGlyphs        TAG_USER+76
  548. #define LH_Parent        TAG_USER+83
  549. #define LH_BlockParent        TAG_USER+84
  550. #define LH_SimpleClone        TAG_USER+90
  551. #define LH_ExitFlush        TAG_USER+108
  552. #define LH_UserData        TAG_USER+116
  553. #define LH_RawKeyFilter        TAG_USER+142
  554.  
  555.  
  556. /*****************************************************************************/
  557.  
  558.  
  559. /* kinds of objects supported in addition to the normal GadTools kinds */
  560. #define HORIZONTAL_KIND        45
  561. #define VERTICAL_KIND        46
  562. #define END_KIND        47
  563. #define FRAME_KIND        48
  564. #define BOX_KIND        49
  565. #define FRACTION_KIND        50
  566. #define XBAR_KIND        51
  567. #define YBAR_KIND        52
  568. #define PASSWORD_KIND        53
  569. #define GAUGE_KIND        54
  570. #define TAPEDECK_KIND        55
  571. #define LEVEL_KIND        56
  572. #define BOOPSI_KIND        57
  573. #define POPUP_KIND        58
  574. #define TAB_KIND        59
  575.  
  576.  
  577. /*****************************************************************************/
  578.  
  579.  
  580. /* in support of FRACTION_KIND gadgets */
  581.  
  582. typedef ULONG            FIXED;
  583. #define FIXED_UNITY        10000
  584.  
  585. #define TO_FIXED(l,r)        (FIXED_UNITY * (l) + (r))
  586. #define FIXED_LEFT(f)        ((f) / FIXED_UNITY)
  587. #define FIXED_RIGHT(f)        ((f) % FIXED_UNITY)
  588.  
  589.  
  590. /*****************************************************************************/
  591.  
  592.  
  593. #ifndef _GTLAYOUT_GLOBAL_H
  594. typedef struct LayoutHandle
  595. {
  596.     struct Screen        *Screen;
  597.     struct DrawInfo        *DrawInfo;
  598.     struct Window        *Window;
  599.     APTR             VisualInfo;
  600.     struct Image        *AmigaGlyph,
  601.                 *CheckGlyph;
  602.     APTR             UserData;    /* Requires gtlayout.library v9 */
  603.     struct Menu        *Menu;        /* Requires gtlayout.library v13 */
  604.     /* private fields follow.... */
  605. } LayoutHandle;
  606. #endif    /* _GTLAYOUT_GLOBAL_H */
  607.  
  608.  
  609. /*****************************************************************************/
  610.  
  611.  
  612. VOID LIBENT            LT_LevelWidth(REG(a0) struct LayoutHandle *handle,REG(a1) STRPTR levelFormat,REG(a2) DISPFUNC dispFunc,REG(d0) LONG min,REG(d1) LONG max,REG(a3) LONG *maxWidth,REG(a5) LONG *maxLen,REG(d2) BOOL fullCheck);
  613. VOID LIBENT            LT_NewLevelWidth(REG(a0) struct LayoutHandle *handle,REG(a1) STRPTR levelFormat,REG(a2) DISPFUNC dispFunc,REG(d0) LONG min,REG(d1) LONG max,REG(a3) LONG *maxWidth,REG(d3) LONG *maxLen,REG(d2) BOOL fullCheck);
  614. VOID LIBENT            LT_DeleteHandle(REG(a0) struct LayoutHandle *Handle);
  615. struct LayoutHandle * LIBENT    LT_CreateHandle(REG(a0) struct Screen *Screen,REG(a1) struct TextAttr *Font);
  616. struct LayoutHandle * LIBENT    LT_CreateHandleTagList(REG(a0) struct Screen *Screen,REG(a1) struct TagItem *TagList);
  617. BOOL LIBENT            LT_RebuildTagList(REG(a0) struct LayoutHandle *handle,REG(d0) BOOL clear,REG(a1) struct TagItem *TagParams);
  618. VOID LIBENT            LT_HandleInput(REG(a0) struct LayoutHandle *Handle,REG(d0) ULONG MsgQualifier,REG(a1) ULONG *MsgClass,REG(a2) UWORD *MsgCode,REG(a3) struct Gadget **MsgGadget);
  619. VOID LIBENT            LT_BeginRefresh(REG(a0) struct LayoutHandle *handle);
  620. VOID LIBENT            LT_EndRefresh(REG(a0) struct LayoutHandle *handle,REG(d0) BOOL complete);
  621. LONG LIBENT            LT_GetAttributesA(REG(a0) struct LayoutHandle *Handle,REG(d0) LONG ID,REG(a1) struct TagItem *TagList);
  622. VOID LIBENT            LT_SetAttributesA(REG(a0) struct LayoutHandle *handle,REG(d0) LONG id,REG(a1) struct TagItem *TagList);
  623. VOID LIBENT            LT_NewA(REG(a0) struct LayoutHandle *handle,REG(a1) struct TagItem *tagList);
  624. VOID LIBENT            LT_EndGroup(REG(a0) struct LayoutHandle *handle);
  625. struct Window * LIBENT        LT_BuildA(REG(a0) struct LayoutHandle *Handle,REG(a1) struct TagItem *TagParams);
  626. struct Menu * LIBENT        LT_LayoutMenusA(REG(a0) struct LayoutHandle *handle,REG(a1) struct NewMenu *menuTemplate,REG(a2) struct TagItem *TagParams);
  627. VOID LIBENT            LT_Fixed2String(REG(d0) FIXED fixed,REG(d1) STRPTR buffer);
  628. FIXED LIBENT            LT_String2Fixed(REG(a0) STRPTR buffer);
  629. ULONG LIBENT            LT_FixedMult(REG(d0) FIXED fixed,REG(d1) ULONG factor);
  630. LONG LIBENT            LT_LabelWidth(REG(a0) struct LayoutHandle *handle,REG(a1) STRPTR label);
  631. LONG LIBENT            LT_LabelChars(REG(a0) struct LayoutHandle *handle,REG(a1) STRPTR label);
  632. VOID LIBENT            LT_LockWindow(REG(a0) struct Window *window);
  633. VOID LIBENT            LT_UnlockWindow(REG(a0) struct Window *window);
  634. VOID LIBENT            LT_DeleteWindowLock(REG(a0) struct Window *window);
  635. VOID LIBENT            LT_ShowWindow(REG(a0) struct LayoutHandle *handle,REG(a1) BOOL activate);
  636. VOID LIBENT            LT_Activate(REG(a0) struct LayoutHandle *handle,REG(d0) LONG id);
  637. VOID LIBENT            LT_PressButton(REG(a0) struct LayoutHandle *handle,REG(d0) LONG id);
  638. WORD LIBENT            LT_GetCode(REG(d0) ULONG MsgQualifier,REG(d1) ULONG MsgClass,REG(d2) UWORD MsgCode,REG(a0) struct Gadget *MsgGadget);
  639. struct IntuiMessage * LIBENT    LT_GetIMsg(REG(a0) struct LayoutHandle *Handle);
  640. VOID LIBENT            LT_ReplyIMsg(REG(a0) struct IntuiMessage *Msg);
  641. VOID LIBENT            LT_UpdateStrings(REG(a0) struct LayoutHandle *Handle);
  642. VOID LIBENT            LT_DisposeMenu(REG(a0) struct Menu *Menu);
  643. struct Menu * LIBENT        LT_NewMenuTemplate(REG(a0) struct Screen *Screen,REG(a1) struct TextAttr *TextAttr,REG(a2) struct Image *AmigaGlyph,REG(a3) struct Image *CheckGlyph,REG(d0) LONG *Error,REG(d1) struct NewMenu *MenuTemplate);
  644. struct Menu * LIBENT        LT_NewMenuTagList(REG(a0) struct TagItem *TagList);
  645. VOID LIBENT            LT_MenuControlTagList(REG(a0) struct Window *Window,REG(a1) struct Menu *IntuitionMenu,REG(a2) struct TagItem *Tags);
  646. struct MenuItem * LIBENT    LT_GetMenuItem(REG(a0) struct Menu *Menu,REG(d0) ULONG ID);
  647. struct MenuItem * LIBENT    LT_FindMenuCommand(REG(a0) struct Menu *Menu,REG(d0) UWORD MsgCode,REG(d1) UWORD MsgQualifier,REG(a1) struct Gadget *MsgGadget);
  648.  
  649.  
  650. /*****************************************************************************/
  651.  
  652.  
  653. /* For use as link library */
  654.  
  655. BOOL LIBENT            LT_Init(VOID);
  656. VOID LIBENT            LT_Exit(VOID);
  657.  
  658. /* Available for library-internal use and as link library */
  659.  
  660. BOOL __stdargs            LT_RebuildTags(struct LayoutHandle *handle,BOOL clear,...);
  661. struct LayoutHandle * __stdargs    LT_CreateHandleTags(struct Screen *Screen,...);
  662. LONG __stdargs            LT_GetAttributes(struct LayoutHandle *Handle,LONG ID,...);
  663. VOID __stdargs            LT_SetAttributes(struct LayoutHandle *handle,LONG id,...);
  664. VOID __stdargs            LT_AddL(struct LayoutHandle *handle,UBYTE type,ULONG labelID,LONG id,...);
  665. VOID __stdargs            LT_Add(struct LayoutHandle *Handle,UBYTE Type,STRPTR Label,LONG ID,...);
  666. VOID __stdargs            LT_New(struct LayoutHandle *handle,...);
  667. struct Window * __stdargs    LT_Build(struct LayoutHandle *Handle,...);
  668. struct Window * __stdargs    LT_Layout(struct LayoutHandle *handle, STRPTR title,struct IBox *bounds,LONG extraWidth, LONG extraHeight,ULONG IDCMP, UBYTE align, ...);
  669. struct Menu * __stdargs        LT_LayoutMenus(struct LayoutHandle *handle,struct NewMenu *menuTemplate,...);
  670.  
  671. struct Menu * __stdargs        LT_NewMenuTags(Tag FirstTag,...);
  672. VOID __stdargs            LT_MenuControlTags(struct Window *Window,struct Menu *Menu,...);
  673.  
  674.  
  675. /*****************************************************************************/
  676.  
  677.  
  678. /* Useful macros */
  679.  
  680. #define LT_GetString(Handle,Code)    ((STRPTR)LT_GetAttributes((Handle),(Code),TAG_DONE))
  681.  
  682. #define LAMN_Menu_UserData(m)        (*(APTR *)(((struct Menu *)(m)) + 1))
  683. #define LAMN_Menu_ID(m)            (((ULONG *)(((struct Menu *)(m)) + 1))[1])
  684.  
  685. #define LAMN_Item_UserData(m)        (*(APTR *)(((struct MenuItem *)(m)) + 1))
  686. #define LAMN_Item_ID(m)            (((ULONG *)(((struct MenuItem *)(m)) + 1))[1])
  687.  
  688.  
  689. /*****************************************************************************/
  690.  
  691.  
  692. /* Obsolete routines, do not use in new code. */
  693.  
  694. BOOL LIBENT                LT_Rebuild(REG(a0) struct LayoutHandle *handle,REG(a1) struct IBox *bounds,REG(a2) LONG extraWidth,REG(d0) LONG extraHeight,REG(d1) BOOL clear);
  695. struct Window * LIBENT            LT_LayoutA(REG(a0) struct LayoutHandle *handle, REG(a1) STRPTR title,REG(a2) struct IBox *bounds,REG(d0) LONG extraWidth, REG(d1) LONG extraHeight,REG(d2) ULONG IDCMP, REG(d3) UBYTE align, REG(a3) struct TagItem *TagParams);
  696. VOID LIBENT                LT_AddA(REG(a0) struct LayoutHandle *Handle,REG(d0) UBYTE Type,REG(d1) STRPTR Label,REG(d2) LONG ID,REG(a1) struct TagItem *TagList);
  697.  
  698. #define LT_GetDrawInfo(Handle)        (Handle) ? ((Handle) -> DrawInfo)    : NULL
  699. #define LT_GetVisualInfo(Handle)    (Handle) ? ((Handle) -> VisualInfo)    : NULL
  700. #define LT_GetScreen(Handle)        (Handle) ? ((Handle) -> Screen)        : NULL
  701. #define LT_SetAutoActivate(Handle,Mode)    LT_SetAttributes(Handle,0,LH_AutoActivate,Mode,TAG_DONE)
  702.  
  703.  
  704. /*****************************************************************************/
  705.  
  706.  
  707. #if !defined(_GTLAYOUT_GLOBAL_H) && !defined(NO_PRAGMAS)
  708. #pragma libcall GTLayoutBase LT_LevelWidth 1e 2DB10A9808
  709. #pragma libcall GTLayoutBase LT_DeleteHandle 24 801
  710. #pragma libcall GTLayoutBase LT_CreateHandle 2a 9802
  711. #pragma libcall GTLayoutBase LT_CreateHandleTagList 30 9802
  712. #pragma tagcall GTLayoutBase LT_CreateHandleTags 30 9802
  713. #pragma libcall GTLayoutBase LT_Rebuild 36 10A9805
  714. #pragma libcall GTLayoutBase LT_HandleInput 3c BA90805
  715. #pragma libcall GTLayoutBase LT_BeginRefresh 42 801
  716. #pragma libcall GTLayoutBase LT_EndRefresh 48 0802
  717. #pragma libcall GTLayoutBase LT_GetAttributesA 4e 90803
  718. #pragma tagcall GTLayoutBase LT_GetAttributes 4e 90803
  719. #pragma libcall GTLayoutBase LT_SetAttributesA 54 90803
  720. #pragma tagcall GTLayoutBase LT_SetAttributes 54 90803
  721. #pragma libcall GTLayoutBase LT_AddA 5a 9210805
  722. #pragma tagcall GTLayoutBase LT_Add 5a 9210805
  723. #pragma libcall GTLayoutBase LT_NewA 60 9802
  724. #pragma tagcall GTLayoutBase LT_New 60 9802
  725. #pragma libcall GTLayoutBase LT_EndGroup 66 801
  726. #pragma libcall GTLayoutBase LT_LayoutA 6c B3210A9808
  727. #pragma tagcall GTLayoutBase LT_Layout 6c B3210A9808
  728. #pragma libcall GTLayoutBase LT_LayoutMenusA 72 A9803
  729. #pragma tagcall GTLayoutBase LT_LayoutMenus 72 A9803
  730. #pragma libcall GTLayoutBase LT_Fixed2String 78 1002
  731. #pragma libcall GTLayoutBase LT_String2Fixed 7e 801
  732. #pragma libcall GTLayoutBase LT_FixedMult 84 1002
  733. #pragma libcall GTLayoutBase LT_LabelWidth 8a 9802
  734. #pragma libcall GTLayoutBase LT_LabelChars 90 9802
  735. #pragma libcall GTLayoutBase LT_LockWindow 96 801
  736. #pragma libcall GTLayoutBase LT_UnlockWindow 9c 801
  737. #pragma libcall GTLayoutBase LT_DeleteWindowLock a2 801
  738. #pragma libcall GTLayoutBase LT_ShowWindow a8 9802
  739. #pragma libcall GTLayoutBase LT_Activate ae 0802
  740. #pragma libcall GTLayoutBase LT_PressButton b4 0802
  741. #pragma libcall GTLayoutBase LT_GetCode ba 821004
  742. /*--- Added in v1.78 --------------------------------------------------*/
  743. #pragma libcall GTLayoutBase LT_GetIMsg c0 801
  744. #pragma libcall GTLayoutBase LT_ReplyIMsg c6 801
  745. /*--- Added in v3.0 ---------------------------------------------------*/
  746. #pragma libcall GTLayoutBase LT_BuildA cc 9802
  747. #pragma tagcall GTLayoutBase LT_Build cc 9802
  748. #pragma libcall GTLayoutBase LT_RebuildTagList d2 90803
  749. #pragma tagcall GTLayoutBase LT_RebuildTags d2 90803
  750. /*--- Added in v9.0 ---------------------------------------------------*/
  751. #pragma libcall GTLayoutBase LT_UpdateStrings d8 801
  752. /*--- Added in v11.0 ---------------------------------------------------*/
  753. #pragma libcall GTLayoutBase LT_DisposeMenu de 801
  754. #pragma libcall GTLayoutBase LT_NewMenuTemplate e4 10BA9806
  755. #pragma libcall GTLayoutBase LT_NewMenuTagList ea 801
  756. #pragma tagcall GTLayoutBase LT_NewMenuTags ea 801
  757. #pragma libcall GTLayoutBase LT_MenuControlTagList f0 A9803
  758. #pragma tagcall GTLayoutBase LT_MenuControlTags f0 A9803
  759. #pragma libcall GTLayoutBase LT_GetMenuItem f6 0802
  760. #pragma libcall GTLayoutBase LT_FindMenuCommand fc 910804
  761. /*--- Added in v14.0 ---------------------------------------------------*/
  762. #pragma libcall GTLayoutBase LT_NewLevelWidth 102 23B10A9808
  763. #endif    /* !_GTLAYOUT_GLOBAL_H && !NO_PRAGMAS */
  764.  
  765.  
  766. /*****************************************************************************/
  767.  
  768.  
  769. #endif    /* _GTLAYOUT_H */
  770.